def parse_device(data, columns_lst):
    if data is None or "list" not in data:
        return None

    data_lst = data["list"]
    if not data_lst:
        data_lst = []

    # 真实要获取的字段
    columns_lst = ["name","number","state","isSwitchCycle","backupStatus","switchCycleRemark"]
    res_table_columns = ["设备名称","设备编号","状态","是否周期切换","备机状态","切换周期/要求"]

    state_mapping = {
        0: '运行中',
        1: '维修中',
        2: '异常',
        3: '停用'
    }


    res_table = []

    for row in data_lst:
        row_lst = []
        row_lst.append(row["name"])
        row_lst.append(row["number"])

        if row["state"] in state_mapping:
            row_lst.append(state_mapping[row["state"]])
        else:
            row_lst.append(row["state"])

        if row["isSwitchCycle"] == 1:
            row_lst.append("√")
        else:
            row_lst.append("x")

        row_lst.append(row["backupStatus"])
        row_lst.append(row["switchCycleRemark"])




        res_table.append(row_lst)


    return {
        "res_table_title": "查询【设备】相关数据如下：",
        "res_table_columns": res_table_columns,
        "res_table": res_table
    }